package day020;

import java.io.*;
import java.util.Arrays;

public class BufferedStreamDemo3 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("D:\\day020\\sort.txt"));
        String line = br.readLine();
        String[] strs = line.split(" ");
        int[] arr = new int[strs.length];
        for (int i = 0; i < strs.length; i++) {
            arr[i] = Integer.parseInt(strs[i]);
        }

        Arrays.sort(arr);
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\day020\\sort.txt"));
        for (int i = 0; i < arr.length; i++) {
            bw.write(arr[i] + " ");
            bw.flush();
        }

        br.close();
        bw.close();
    }
}
